import request from '@/utils/request';
import qs from 'qs';
// 创建代理商
export const agentPath = {
  getQuery: '/org/agent/query'
};
// 增加
export function agentAdd(data) {
  return request({

    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/create',
    method: 'post',
    data
  });
}
// 修改代理商
export function edit(data) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/update',
    method: 'post',
    data
  });
}
// 根据集团编号查询
export function agentSearchId(params) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/id/' + params,
    method: 'get'
  });
}
//删除代理商
export function del(data) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/delete',
    method: 'post',
    data
  });
}

export function archive(data) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + 'patient/archive',
    method: 'put',
    data
  });
}


// 导出代理商
export function download(params) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/download' + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  });
}
// 查询代理商。
export function getPageConf(params) {
  return request({
    url: process.env.VUE_APP_SALEAREA_API + '/org/agent/query',
    method: 'get',
    params
  });
}
// 查询发票。
export function invoiceQuery(params) {
  return request({
    url: process.env.VUE_APP_PRODUCT_API + '/oper/invoice/query',
    method: 'get',
    params
  });
}

// 新建合同
export function agentAddContract(data) {
  return request({  
    url: process.env.VUE_APP_PRODUCT_API + '/oper/contract/create',
    method: 'post',
    data
  });}



